class Invoice < ActiveRecord::Base
  attr_accessible :customer_id, :user_id, :invoice_items_attributes
  
  has_many :invoice_items
  accepts_nested_attributes_for :invoice_items, :reject_if => :all_blank, :allow_destroy => true
  
  belongs_to :customer
  belongs_to :user
  
  validates_presence_of :customer_id
    
end
